package org.jeecg.modules.nc.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.modules.nc.entity.NcPersonnel;
import org.jeecg.modules.nc.mapper.NcPersonnelMapper;
import org.jeecg.modules.nc.vo.NCPersonAndJobVo;
import org.jeecg.modules.nc.vo.NCPersonVO;
import org.jeecg.modules.nc.vo.SysUserPsnVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.jeecg.modules.nc.service.INcPersonnelService;

import java.util.List;
import java.util.Map;

/**
 * @Description: nc_personnel
 * @Author: qixin-boot
 * @Date:   2021-11-30
 * @Version: V1.0
 */
@Service
public class NcPersonnelServiceImpl extends ServiceImpl<NcPersonnelMapper, NcPersonnel> implements INcPersonnelService {

    @Autowired
    private NcPersonnelMapper ncPersonnelMapper;


    @Override
    public List<NCPersonAndJobVo> queryNCPersonelList() {
        List<NCPersonAndJobVo> ncPersonnelList = ncPersonnelMapper.queryNCPersonelList();
        return ncPersonnelList;
    }

    @Override
    public List<NcPersonnel> queryPsnByDepId(String id) {
        List<NcPersonnel> psnList = ncPersonnelMapper.queryPsnByDepId(id);
        return psnList;
    }

    @Override
    public NcPersonnel queryById(String id) {
        NcPersonnel ncPersonnel = ncPersonnelMapper.selectById(id);
        return ncPersonnel;
    }

    @Override
    public NcPersonnel queryByUserid(String userId) {
        NcPersonnel ncPersonnel = ncPersonnelMapper.queryByUserid(userId);
        return ncPersonnel;
    }

    @Override
    public List<NCPersonVO> queryNcPsnListByPkpsndoc(String pkPsndoc) {
        return ncPersonnelMapper.queryNcPsnListByPkpsndoc(pkPsndoc);
    }

    @Override
    public void updatePsNOrgAndDept() {
        ncPersonnelMapper.updateDeptName();
        ncPersonnelMapper.updateOrgName();
    }

    @Override
    public List<SysUserPsnVo> selectPsnByPkpsndoc(Map<String,Object> map) {
        List<SysUserPsnVo> sysUserPsnVos = ncPersonnelMapper.selectPsnByPkpsndoc(map);
        return sysUserPsnVos;
    }

    @Override
    public IPage<NCPersonAndJobVo> queryPersonList(Page<NCPersonAndJobVo> page, QueryWrapper<NCPersonAndJobVo> queryWrapper) {
        return ncPersonnelMapper.queryPersonList(page,queryWrapper);
    }


}
